package com.tianqu.tms.core.base;

import java.sql.Connection;

import com.tianqu.tms.core.exception.ConnectionException;
import com.tianqu.tms.core.util.Registry;
import com.tianqu.tms.core.util.TmsConstants;

/**
 * 
 * @author liugang
 *
 */
public abstract class ConnectionFactory implements TmsConstants {
	/**
	 * ConnectionFactory
	 *@return ConnectionFactory
	 */
	public static ConnectionFactory getInstance() {
		return (ConnectionFactory) Registry.get(CONNECTION_FACTORY);
	}
	/**
	 * getConnection
	 * @throws Exception
	 *@return Connection
	 * @throws ClassNotFoundException 
	 * @throws InstantiationException 
	 * @throws IllegalAccessException 
	 */
	public abstract Connection getConnection() throws ConnectionException;
}
